/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.autoescola.core.service.security.role;

import com.autoescola.core.entity.security.Role;
import com.autoescola.core.entity.security.User;
import com.autoescola.core.service.Service;
import java.util.List;
import javax.annotation.security.DeclareRoles;
import javax.enterprise.inject.Produces;
import javax.validation.constraints.NotNull;

/**
 *
 * @author leonardo luz fernandes
 * @version 0.1
 * @since 01/11/2010
 */

@DeclareRoles(value="administrator")
@Service
public interface RoleService {

    public Role create( @NotNull Role role );
    public Role update( @NotNull Role role );
    public Role delete( @NotNull Role role );

    @Produces
    public List<Role> list();

    public boolean add( @NotNull User user , @NotNull Role role );
    public boolean remove( @NotNull User user , @NotNull Role role );

    @Produces
    public List<Role> listRoles( @NotNull User user );

    @Produces
    public List<User> listUsers( @NotNull Role role );

}//end interface
